package com.xu.blog_after_end.web;

import com.xu.blog_after_end.service.BlogService;
import com.xu.blog_after_end.service.TagService;
import com.xu.blog_after_end.service.TypeService;
import com.xu.blog_after_end.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.ui.Model;

@Controller
public class AboutShowController {
    @Autowired
    private UserService userService;
    @Autowired
    private TypeService typeService;
    @Autowired
    private TagService tagService;
    @GetMapping("/about")
    public String about(Model model){
        model.addAttribute("types", typeService.listTypeTop(6));
        model.addAttribute("tags", tagService.listTagTop(10));
        model.addAttribute("user", userService.getUserInfo());

        return "about";
    }
}
